﻿Option Explicit On
Option Strict On
Imports System.Data
Imports System.Text
Imports System.Configuration
Imports MySql.Data.MySqlClient
Imports System.Globalization

Public Class frmReport

    Dim Conn As New MySqlConnection()
    Dim com As New MySqlCommand()
    Dim sb As New StringBuilder()
    Dim dr As MySqlDataReader
    Dim dt As DataTable

    Private Sub frmReport_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim strConn As String = ConfigurationManager.ConnectionStrings("equ").ConnectionString
        If Conn.State = ConnectionState.Open Then
            Conn.Close()
        End If
        Conn.ConnectionString = strConn
        Conn.Open()

        Dim dt As DateTime = DateTime.Today
        Dim ThaiInfo As New CultureInfo("th-TH")
        Dim ThaiFormat As DateTimeFormatInfo = ThaiInfo.DateTimeFormat
        Dim CurrentYear = dt.ToString("yyyy", ThaiFormat)

        Dim i As Integer = 1
        Dim YearLists = Convert.ToInt32(CurrentYear) - 10
        With cbbYear
            For i = 1 To 10
                .Items.Add(YearLists + i)
            Next
            .SelectedIndex = 9
        End With
        btnExport.Enabled = False
    End Sub

    Private Sub btnBorrow_Click(sender As Object, e As EventArgs) Handles btnBorrow.Click
       
    End Sub
End Class